/* Created by Aquariuslt on 5/20/17.*/


navbarController.$inject = ['navMenuService','$scope','$location'];
function navbarController(navMenuService,$scope, $location) {
  var vm = this;

  $scope.flag = sessionStorage.flag;
  vm.menus = navMenuService.getMenus();

  if(sessionStorage.flag=='true') {

    $scope.client=JSON.parse(sessionStorage.client);
    $scope.flag = true;
  }else {
    $scope.flag = false;
  }
  $scope.logout = function() {
    sessionStorage.clear();
    $scope.client=null;
    sessionStorage.flag=false;
    $scope.flag = false;
    $location.path('/welcome');
  }
}


module.exports = navbarController;